package com.example.libo.huihui.fragment;

import android.support.v4.app.Fragment;

/**
 * Created by libo on 2017/1/16.
 */

public abstract class BaseFragment extends Fragment{
    protected boolean isVisible;

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if(getUserVisibleHint()){  //如果该fragment可见
            isVisible = true;
            lazyLoad();
        }else{
            isVisible = false;
        }
    }

    protected abstract void lazyLoad();
}
